//
//  RadioModel.m
//  NewMusic
//
//  Created by chuxinyu123 on 15/11/18.
//  Copyright © 2015年 Going. All rights reserved.
//

#import "RadioModel.h"

@implementation RadioModel
- (void)dealloc
{
    [_tag_type_name release];
    [_dataArray release];
    [super dealloc];
}

- (instancetype)initWithDictionary:(NSDictionary *)dictionary
{
    self = [super init];
    if (self) {
        self.dataArray = [NSMutableArray array];
        [self setValuesForKeysWithDictionary:dictionary];
    }
    return self;
}

+ (RadioModel *)radioModelWithDictionary:(NSDictionary *)dictionary
{
    RadioModel *radioModel = [[RadioModel alloc] initWithDictionary:dictionary];
    return radioModel;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}
- (void)setValue:(id)value forKey:(NSString *)key
{
    if ([key isEqual:@"data"]) {
        for (NSDictionary *dic in value) {
            RadioDataModel *radioDataModel = [RadioDataModel radioDataModelWithDictionary:dic];
            [self.dataArray addObject:radioDataModel];
        }
    }else{
        [super setValue:value forKey:key];
    }
}

@end
